﻿@namespace BlazorComponent
@inherits BDomComponentBase
@typeparam TItem

<div class="@CssProvider.GetClass(this)" style="@CssProvider.GetStyle(this)" @ref="Ref">
    <CascadingValue Value="this" Name="Tree" IsFixed="@true">
        @if (DataSource != null)
        {
            foreach (var item in DataSource)
            {
                <SlotComponent DataItem="@item" @key="item.GetHashCode()" Description="SlotProvider.GetSlot<BTreeItem<TItem>>()"></SlotComponent>
            }
        }
        else
        {
            <div class="@CssProvider.GetClass(this,"child")">
                @Nodes
            </div>
        }
    </CascadingValue>
</div>
